home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 027a / clipio.zip / BLAKBOOK.PRG < prev    next >
Text File  |  1990-06-23  |  22KB  |  741 lines

  1. reindex = (pcount() > 0)
  2.  
  3. restore from blakbook.mem additive
  4.  
  5. if !iscolor()
  6.     _c_addr_en = 112
  7.     _c_fami_en = 112
  8.     _c_memb_en = 112
  9.     _c_menu_en = 112
  10.  
  11.     _c_addr_st = 7
  12.     _c_fami_st = 7
  13.     _c_memb_st = 7
  14.     _c_menu_st = 7
  15.  
  16.     _c_addr_un = 1
  17.     _c_fami_un = 1
  18.     _c_memb_un = 1
  19.     _c_menu_un = 112
  20.  
  21.     _c_fram = 7
  22.     _c_help = 7
  23.     _c_hlpk = 112
  24.     _c_note = 7
  25.  
  26.     _c_wind_en = 7
  27.     _c_wind_st = 112
  28.     _c_wind_un = 1
  29. endif
  30.  
  31. * SET up
  32.     set scoreboard off
  33.     vsetcursor(.f.)
  34.     readexit(.f.)
  35.     setcancel(.f.)
  36.  
  37. private main[12], print[6], system[4]
  38. private ffields[2], fpics[2], mfields[5], mpics[5], ekeys[5], edesc[5]
  39. private appending, ctrlsaved, famictrl, piccount, passclick, passchoice
  40. private findmemb
  41.  
  42. main[1] = 'Address'
  43. main[2] = 'Call'
  44. main[3] = 'Delete'
  45. main[4] = 'Edit'
  46. main[5] = 'Families'
  47. main[6] = 'Insert'
  48. main[7] = 'Locate'
  49. main[8] = 'Members'
  50. main[9] = 'Notes'
  51. main[10] = 'Print'
  52. main[11] = 'Quit'
  53. main[12] = 'System'
  54.  
  55. print[1] = 'Address book'
  56. print[2] = 'Anniversary schedule'
  57. print[3] = 'Birthday and anniversary calendar'
  58. print[4] = 'Birthday schedule'
  59. print[5] = 'Envelope'
  60. print[6] = 'Phone book'
  61.  
  62. system[1] = 'Colors'
  63. system[2] = 'Database maintenance'
  64. system[3] = 'Modem settings'
  65. system[4] = 'Printer control codes'
  66.  
  67. ffields[1] = [NAME]
  68. ffields[2] = [PHONE]
  69.  
  70. fpics[1] = [!xxxxxxxxxxxxxx]
  71. fpics[2] = [(999)999-9999]
  72.  
  73. mfields[1] = [NAME]
  74. mfields[2] = [MINIT]
  75. mfields[3] = [PHONE]
  76. mfields[4] = [BIRTHDAY]
  77. mfields[5] = [ANNIVERS]
  78.  
  79. mpics[1] = [!xxxxxxxxxxx]
  80. mpics[2] = [!]
  81. mpics[3] = [(999)999-9999]
  82. mpics[4] = [@D]
  83. mpics[5] = [@D]
  84.  
  85. ekeys[1] = 'F1'
  86. ekeys[2] = chr(27)+'/'+chr(26)
  87. ekeys[3] = chr(24)+'/'+chr(25)
  88. ekeys[4] = 'PgDn'
  89. ekeys[5] = 'ESC'
  90.  
  91. edesc[1] = 'Help'
  92. edesc[2] = 'Prev/Next char'
  93. edesc[3] = 'Prev/Next field'
  94. edesc[4] = 'Save changes'
  95. edesc[5] = 'Abort changes'
  96.  
  97. * begin
  98.     set key 289 to Free_Memory  && alt-F
  99.     passclick = .f.
  100.     passchoice = 0
  101.     vsetstan(_c_fram)
  102.     clear
  103.     DrawScreen()
  104.  
  105.     * initialize mouse
  106.     msetcursor(.t.)             &&turn mouse cursor on
  107.     msetbutton(.t.)             &&turn button-press tracking on
  108.     mdefctrl(0, 0, 0, 79, 255)  &&define menubar as ctrl code 255
  109.     mdefctrl(4, 1, 12, 29, 251)
  110.     mdefctrl(4, 33, 12, 78, 252)
  111.     mdefctrl(16, 1, 22, 37, 253)
  112.     mdefctrl(16, 41, 22, 78, 254)
  113.  
  114.     *** define page up, down, etc. ***
  115.     mdefctrl(1, 30, 2, 32, 240)
  116.     mdefctrl(3, 30, 4, 32, 239)
  117.     mdefctrl(5, 30, 6, 32, 238)
  118.     mdefctrl(8, 30, 9, 32, 237)
  119.     mdefctrl(10, 30, 11, 32, 236)
  120.     mdefctrl(12, 30, 13, 32, 235)
  121.  
  122.     tourguide()
  123.  
  124.     select 0
  125.     use MEMBERS
  126.     select 0
  127.     use FAMILIES
  128.     if reindex
  129.         blakpack()
  130.     endif
  131.     select MEMBERS
  132.     set index to MEMBUNIQ, MEMBBIRT, MEMBANNI
  133.     set filter to (!deleted())
  134.     select FAMILIES
  135.     set index to FAMINAME, FAMIUNIQ
  136.     set filter to (!deleted())
  137.     go top
  138.     lastrecno = 0
  139.     appending = .f.
  140.     ctrlsaved = .f.
  141.     findmemb = 0
  142.     keyinsert(-71)
  143.     menuedit(4, 1, 12, '│', ffields, fpics, 'fami_monitor')
  144. return
  145.  
  146. *--------------------------------FAMI_MONITOR----------------------------------*
  147.  
  148. function Fami_Monitor
  149.  
  150. parameters Mode, fld_ptr
  151.  
  152. private return_val, lastkey, choice, hrow
  153.  
  154. * begin
  155.     return_val = 1
  156.     if mode = 0
  157.         if !ctrlsaved
  158.             famictrl = msavectrl(4, 1, 12, 29)
  159.             ctrlsaved = .t.
  160.         endif
  161.         if recno() <> lastrecno
  162.             lastrecno = recno()
  163.             dispmembers()
  164.             dispaddress()
  165.             dispnotes()
  166.         endif
  167.     elseif mode = 1 .or. mode = 2
  168.         tone(100,1)
  169.     elseif mode = 3
  170.         if prompt(7, -1, 'The address book is empty.  You can...', .t., 'Insert', 'Abort') = 'I'
  171.             keyinsert(-23)
  172.             lastkey = inkey(0)
  173.         else
  174.             return 0
  175.         endif
  176.         mode = 4
  177.     endif
  178.     if mode = 4
  179.         lastkey = lastkey()
  180.         hrow = row()
  181.         vfillattr(hrow, 1, hrow, 29, _c_fami_en)
  182.         if ((keyconv(lastkey) >= -50) .and. (keyconv(lastkey) <= -16)) .or.;
  183.            ((lastkey = 387) .and. (mgetbutton() == 'L ') .and. (mgetctrl() = 255)) .or.;
  184.            (passchoice > 0)
  185.             do while .t.
  186.                 if passchoice = 0
  187.                     choice = showmenu()
  188.                 else
  189.                     choice = passchoice
  190.                     passchoice = 0
  191.                     vpushstate()
  192.                     vsetcolor(_c_menu_st, _c_menu_en, _c_menu_un)
  193.                     menuline(0, 0, 79, main)
  194.                     vpopstate()
  195.                 endif
  196.                 do case
  197.                 case choice = 10
  198.                     FamiAddress()
  199.                     vpopscrn()
  200.                 case choice = 20
  201.                     BlakDial()
  202.                     vpopscrn()
  203.                 case choice = 30
  204.                     FamiDel(@return_val)
  205.                     vpopscrn()
  206.                 case choice = 40
  207.                     FamiEd(@return_val)
  208.                     vpopscrn()
  209.                 case choice = 50
  210.                     *** Families ***
  211.                     vpopscrn()
  212.                 case choice = 60
  213.                     FamiAdd()
  214.                     vpopscrn()
  215.                     return_val = 2
  216.                 case choice = 70
  217.                     FamiFind(@return_val)
  218.                     vpopscrn()
  219.                 case choice = 80
  220.                     BlakMemb()
  221.                     vpopscrn()
  222.                 case choice = 90
  223.                     FamiNote()
  224.                     vpopscrn()
  225.                 case (choice > 100) .and. (choice < 110)
  226.                     BlakPrnt(choice % 10)
  227.                     vpopscrn()
  228.                     vpopscrn()
  229.                 case choice = 110
  230.                     sys_exit()
  231.                 case (choice > 120) .and. (choice < 130)
  232.                     BlakSyst(choice % 10)
  233.                     vpopscrn()
  234.                     vpopscrn()
  235.                 endcase
  236.                 if passchoice = 0
  237.                     exit
  238.                 endif
  239.             enddo
  240.         elseif (lastkey = 387) .and. (mgetbutton() == 'L ') .and. (mgetctrl() < 255)
  241.             if mgetctrl() = 252     &&Members
  242.                 keyinsert(-50)
  243.                 passclick = .t.
  244.             elseif mgetctrl() = 253 &&Address
  245.                 keyinsert(-30)
  246.                 passclick = .t.
  247.             elseif mgetctrl() = 254 &&Notes
  248.                 keyinsert(-49)
  249.                 passclick = .t.
  250.             elseif mgetctrl() = 240
  251.                 keyinsert(-132)
  252.             elseif mgetctrl() = 239
  253.                 keyinsert(-73)
  254.             elseif mgetctrl() = 238
  255.                 keyinsert(-72)
  256.             elseif mgetctrl() = 237
  257.                 keyinsert(-80)
  258.             elseif mgetctrl() = 236
  259.                 keyinsert(-81)
  260.             elseif mgetctrl() = 235
  261.                 keyinsert(-118)
  262.             endif
  263.         elseif (lastkey = 13) .or. (lastkey = 25) .or. ((lastkey >= 32) .and. (lastkey <= 255))
  264.             vfillattr(hrow, 1, hrow, 29, _c_fami_st)
  265.             if (lastkey <> 13)
  266.                 keyinsert(keyconv(lastkey))
  267.             endif
  268.             FamiRead(ffields[fld_ptr], fpics[fld_ptr], @return_val)
  269.         elseif lastkey = 27
  270.             sys_exit()
  271.         endif
  272.         if recno() <> lastrecno
  273.             lastrecno = recno()
  274.             dispmembers()
  275.             dispaddress()
  276.             dispnotes()
  277.         endif
  278.         vfillattr(hrow, 1, hrow, 29, _c_fami_st)
  279.     endif
  280. return return_val
  281.  
  282. *----------------------------------FAMIREAD------------------------------------*
  283.  
  284. function FamiRead
  285. parameters fieldname, pic, ret_val
  286.  
  287. private old_key
  288.  
  289. * begin
  290.     old_key = get_key()
  291.     @ row(), col() get &fieldname picture pic
  292.     vsetcursor(.t.)
  293.     readexit(.t.)
  294.     read
  295.     readexit(.f.)
  296.     vsetcursor(.f.)
  297.     if (lastkey() = 5) .or. (lastkey() = 24)
  298.         keyinsert(keyconv(lastkey()))
  299.     endif
  300.     if (.not. old_key == get_key())
  301.         ret_val = 2
  302.     endif
  303. return ''
  304.  
  305. *----------------------------------FAMIFIND------------------------------------*
  306.  
  307. function FamiFind
  308. parameters ret_val
  309.  
  310. private fnamem, lnamem, old_rec
  311.  
  312. * begin
  313.     old_rec = recno()
  314.     lnamem = space(15)
  315.     fnamem = space(12)
  316.     vsetcolor(_c_wind_st, _c_wind_en, _c_wind_un)
  317.     prompt(17, -1, "Enter all or part of name (last, first): " + lnamem + ', ' + fnamem, .f.)
  318.     @ row(), col()-29 get lnamem
  319.     @ row(), col() say ',' get fnamem
  320.     vsetcursor(.t.)
  321.     read
  322.     vsetcursor(.f.)
  323.     vsetcolor(_c_fami_st, _c_fami_en, _c_fami_un)
  324.     lnamem = upper(trim(lnamem))
  325.     if .not. empty(lnamem)
  326.         seek lnamem
  327.         if .not. found()
  328.             tone(100, 1)
  329.             goto old_rec
  330.         else
  331.             if .not. empty(fnamem)
  332.                  fnamem = upper(trim(fnamem))
  333.                  found = .f.
  334.                  do while (upper(NAME) = lnamem) .and. (.not. found)
  335.                      select MEMBERS
  336.                      seek FAMILIES->UNIQUE + fnamem
  337.                      found = found()
  338.                      select FAMILIES
  339.                      if .not. found
  340.                          skip
  341.                      endif
  342.                  enddo
  343.                 if found
  344.                     ret_val = 2
  345.                     keyinsert(-50)      &&invoke members
  346.                     select MEMBERS
  347.                     findmemb = recno()
  348.                     select FAMILIES
  349.                  else
  350.                      tone(100, 1)
  351.                      goto old_rec
  352.                  endif
  353.             else
  354.                 ret_val = 2
  355.             endif
  356.         endif
  357.     endif
  358.     vpopscrn()
  359. return ''
  360.  
  361. *----------------------------------FAMIADD-------------------------------------*
  362.  
  363. function FamiAdd
  364. parameters ret_val
  365.  
  366. private new_unique
  367.  
  368. * begin
  369.     set order to 2
  370.     go bott
  371.     if lastrec() = 0
  372.         new_unique = replicate(chr(1), 4)
  373.     else
  374.         new_unique = inc_uniq(UNIQUE)
  375.     endif
  376.     set order to 1
  377.     append blank
  378.     replace UNIQUE with new_unique
  379.     ret_val = 2
  380.     appending = .t.
  381.     keyinsert(-18)              &&call edit record by stuffing alt-E
  382. return ''
  383.  
  384. *----------------------------------FAMIDEL-------------------------------------*
  385.  
  386. function famidel
  387. parameters ret_val
  388.  
  389. private row
  390.  
  391. * begin
  392.     row = row()
  393.     vfillattr(row, 1, row, 29, _c_fami_en)
  394.     if prompt(-1, -1, 'Are you sure that you want to permanently delete this family?', .t., 'Yes', 'No') = 'Y'
  395.         ret_val = 2
  396.         select MEMBERS
  397.         seek FAMILIES->UNIQUE
  398.         do while (UNIQUE == FAMILIES->UNIQUE)
  399.             delete
  400.             skip
  401.         enddo
  402.         select FAMILIES
  403.         DELETE
  404.         skip
  405.     endif
  406.     vfillattr(row, 1, row, 29, _c_fami_st)
  407. return ''
  408.  
  409. *-----------------------------------FAMIED-------------------------------------*
  410.  
  411. function FamiEd
  412. parameters ret_val
  413.  
  414. private old_key, row
  415.  
  416. * begin
  417.     row = row()
  418.     old_key = get_key()
  419.     @ row,1 get NAME picture fpics[1]
  420.     @ row,col() say '│'
  421.     @ row,col() get PHONE picture fpics[2]
  422.     helpbar(edesc, ekeys)
  423.     vsetcursor(.t.)
  424.     mpushstate()
  425.     msetcursor(.t.)
  426.     msetbutton(.t.)
  427.     set key 387 to findclick
  428.     read
  429.     set key 387 to
  430.     mpopstate()
  431.     vsetcursor(.f.)
  432.     vpopscrn()
  433.     if (.not. old_key == get_key()) .or. appending
  434.         ret_val = 2
  435.     endif
  436.     if appending
  437.         keyinsert(-30)
  438.     endif
  439.     vfillattr(row, 1, row, 29, _c_fami_st)
  440. return ''
  441.  
  442. *--------------------------------FAMIADDRESS-----------------------------------*
  443.  
  444. function FamiAddress
  445. parameters ret_val
  446.  
  447. private old_key
  448.  
  449. * begin
  450.     mdefctrl(16, 1, 22, 37, 0)
  451.     mdefctrl(4, 1, 12, 29, 251)
  452.     vsetcolor(_c_addr_st, _c_addr_en, _c_addr_un)
  453.     vfillchar(16, 1, 22, 37, 32)
  454.     helpbar(edesc, ekeys)
  455.     vsetcursor(.t.)
  456.     *** activate Alt keys in menubar
  457.     set key 302 to altkey
  458.     set key 288 to altkey
  459.     set key 274 to altkey
  460.     set key 289 to altkey
  461.     set key 279 to altkey
  462.     set key 294 to altkey
  463.     set key 306 to altkey
  464.     set key 305 to altkey
  465.     set key 281 to altkey
  466.     set key 272 to altkey
  467.     set key 287 to altkey
  468.     set key 387 to altkey
  469.     piccount = 1
  470.     @ 17, 2 get ADDRESS1 picture mpic(ADDRESS1, '!XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
  471.     @ 19, 2 get ADDRESS2 picture mpic(ADDRESS2, '!XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX')
  472.     @ 21, 2 get CITY picture mpic(CITY, '!XXXXXXXXXXXXXXXXXXX')
  473.     vputstrc(21, 22, ',', _c_addr_st)
  474.     @ 21, 24 get STATE picture mpic(STATE, '!!')
  475.     @ 21, 27 get ZIP picture mpic(ZIP, '#####-####')
  476.     if passclick
  477.         passclick = .f.
  478.         keyinsert(-131)
  479.     endif
  480.     read
  481.     set key 302 to
  482.     set key 288 to
  483.     set key 274 to
  484.     set key 289 to
  485.     set key 279 to
  486.     set key 294 to
  487.     set key 306 to
  488.     set key 305 to
  489.     set key 281 to
  490.     set key 272 to
  491.     set key 287 to
  492.     set key 387 to
  493.     vsetcursor(.f.)
  494.     vpopscrn()
  495.     mdefctrl(16, 1, 22, 37, 253)
  496.     mrestctrl(4, 1, 12, 29, famictrl)
  497.     vsetcolor(_c_fami_st, _c_fami_en, _c_fami_un)
  498.     if appending
  499.         keyinsert(-50)
  500.     endif
  501. return ''
  502.  
  503. function altkey
  504. parameters callprog, linenum, inputvar
  505.  
  506. private lcv, ctrl
  507.  
  508. * begin
  509.     if ((lastkey() = 387) .and. (mgetbutton() == 'L ') .and. (mgetctrl() = 255)) .or.;
  510.        ((keyconv(lastkey()) >= -50) .and. (keyconv(lastkey()) <= -16))
  511.         choice = showmenu()
  512.         if choice <> 10
  513.             passchoice = choice
  514.             keyinsert(23)
  515.         endif
  516.     elseif (lastkey() = 387) .and. (mgetbutton() == 'L ')
  517.         if (mgetctrl() > 0) .and. (mgetctrl() < 11)
  518.             findclick()
  519.         elseif (mgetctrl() = 251)   &&families
  520.             keyinsert(23)
  521.             keyinsert(-131)
  522.             passclick = .t.
  523.         elseif mgetctrl() = 252     &&Members
  524.             keyinsert(23)
  525.             keyinsert(-50)
  526.             passclick = .t.
  527.         elseif mgetctrl() = 254     &&Notes
  528.             keyinsert(23)
  529.             keyinsert(-49)
  530.         endif
  531.     endif
  532. return ''
  533.  
  534. *---------------------------------DISPADDRESS----------------------------------*
  535.  
  536. function dispaddress
  537.  
  538. * begin
  539.     vputstrc(17, 2, ADDRESS1, _c_addr_un)
  540.     vputstrc(19, 2, ADDRESS2, _c_addr_un)
  541.     vputstrc(21, 2, CITY, _c_addr_un)
  542.     vputstrc(21, 22, ',', _c_addr_st)
  543.     vputstrc(21, 24, STATE, _c_addr_un)
  544.     vputstrc(21, 27, ZIP, _c_addr_un)
  545. return ''
  546.  
  547. *----------------------------------FAMINOTE------------------------------------*
  548.  
  549. function FamiNote
  550.  
  551. private mkeys[4], mdesc[4]
  552.  
  553. mkeys[1] = 'Ctrl-B'
  554. mkeys[2] = 'Ctrl-Y'
  555. mkeys[3] = 'Ctrl-W'
  556. mkeys[4] = 'ESC'
  557.  
  558. mdesc[1] = 'Reformat memo'
  559. mdesc[2] = 'Delete line'
  560. mdesc[3] = 'Exit and save'
  561. mdesc[4] = 'Exit and abort'
  562.  
  563. * begin
  564.     mdefctrl(4, 1, 12, 29, 251)
  565.     vsetcolor(_c_addr_st, _c_addr_en, _c_addr_un)
  566.     helpbar(mdesc, mkeys)
  567.     vsetstan(_c_note)
  568.     vsetcursor(.t.)
  569.     replace NOTES with memoedit(NOTES, 16, 41, 22, 78, .t., 'memo_monitor')
  570.     vsetcursor(.f.)
  571.     vpopscrn()
  572.     mdefctrl(16, 41, 22, 78, 254)
  573.     mrestctrl(4, 1, 12, 29, famictrl)
  574.     vsetcolor(_c_fami_st, _c_fami_en, _c_fami_un)
  575. return ''
  576.  
  577. *-----------------------------------DISPNOTES----------------------------------*
  578.  
  579. function dispnotes
  580.  
  581. private row
  582.  
  583. * begin
  584.     vfillchar(16, 41, 22, 78, 32)
  585.     for row = 16 to 22
  586.         vputstr(row, 41, memoline(NOTES, 38, row - 15, 4, .t.))
  587.     next row
  588. return ''
  589.  
  590. *---------------------------------MEMO_MONITOR---------------------------------*
  591.  
  592. function memo_monitor
  593. parameters status, line, col
  594.  
  595. private choice
  596.  
  597. * begin
  598.     if (status = 1 .or. status = 2)
  599.        if ((keyconv(lastkey()) >= -50) .and. (keyconv(lastkey()) <= -16))
  600.             choice = showmenu()
  601.             if choice <> 90
  602.                 passchoice = choice
  603.                 return 23
  604.             endif
  605.         elseif (lastkey() = 387) .and. (mgetbutton() == 'L ')
  606.             if mgetctrl() = 251         &&families
  607.                 keyinsert(-131)
  608.                 return 23
  609.             elseif mgetctrl() = 252         &&Members
  610.                 keyinsert(-50)
  611.             elseif mgetctrl() = 253     &&address
  612.                 keyinsert(-30)
  613.             endif
  614.             if ((mgetctrl() > 251) .and. (mgetctrl() <> 254))
  615.                 passclick = .t.
  616.                 return 23
  617.             endif
  618.         endif
  619.     endif
  620.     return 0
  621. * end
  622.  
  623. *--------------------------------DISPMEMBERS-----------------------------------*
  624.  
  625. function DispMembers
  626.  
  627. private row
  628.  
  629. * begin
  630.     select MEMBERS
  631.     vsetcolor(_c_memb_st, _c_memb_en, _c_memb_un)
  632.     menuedit(4, 33, 12, '│', mfields, mpics, 'memb_monitor', 'UNIQUE == FAMILIES->UNIQUE', FAMILIES->UNIQUE, '')
  633.     vsetcolor(_c_fami_st, _c_fami_en, _c_fami_un)
  634.     select FAMILIES
  635. return ''
  636.  
  637. *---------------------------------DRAWSCREEN-----------------------------------*
  638.  
  639. function DrawScreen
  640.  
  641. * begin
  642.     vsetstan(_c_fram)
  643.     @ 1,0 to 23,79 double
  644.     vputstrc(1, 0, '╔═══════════════╤═════════════╤═╤════════════╤═╤═════════════╤════════╤════════╗')
  645.     vputstrc(2, 1,  '   Last Name   │  Home Phone │ │ First Name │M│ Office Phone│Birthday│Annivers')
  646.     vputstrc(3, 0, '╟───────────────┼─────────────┤ ├────────────┼─┼─────────────┼────────┼────────╢')
  647.     @ 4,30 to 12,30
  648.     vputchar(2,31,12,31,'T─────B')
  649.     vfillattr(2,31,12,31,_c_menu_st)
  650.     @ 4,32 to 12,32
  651.     vfillattr(4, 1, 12, 29, _c_fami_st)
  652.     vfillattr(4, 33, 12, 78, _c_memb_st)
  653.     vputstrc(13, 0,'╠═══════════════╧═════════════╧═╧═════╤╦╤════╧═╧═════════════╧════════╧════════╣')
  654.     vputstrc(14, 1, '              Address                │║│              Notes, Etc.             ')
  655.     vputstrc(15, 0,'╟─────────────────────────────────────┤║├──────────────────────────────────────╢')
  656.     @ 16,38 to 22,38
  657.     @ 16,39 to 22,39 double
  658.     @ 16,40 to 22,40
  659.     vfillattr(16, 1, 22, 37, _c_addr_st)
  660.     vfillattr(16, 41, 22, 78, _c_note)
  661.     vputstrc(23, 0,'╚═════════════════════════════════════╧╩╧══════════════════════════════════════╝')
  662.     vsetcolor(_c_menu_st, _c_menu_en, _c_menu_un)
  663.     menuline(0, 0, 79, main)
  664.     vputstrc(24, 0, 'To select, use arrow keys to highlight and press '+chr(17)+'─┘ or press <Alt>-first letter', _c_menu_st)
  665.     vsetcolor(_c_fami_st, _c_fami_en, _c_fami_un)
  666. return ''
  667.  
  668. *----------------------------------SHOWMENU------------------------------------*
  669.  
  670. function showmenu
  671.  
  672. private choice
  673.  
  674. * begin
  675.     vpushstate()
  676.     vsetcolor(_c_menu_st, _c_menu_en, _c_menu_un)
  677.     keyinsert(keyconv(lastkey()))
  678.     choice = menubar(0, 0, 79, 10, main, '', '', '', '', '', '', '', '', '', print, '', system)
  679.     vpopstate()
  680. return choice
  681.  
  682. *----------------------------------SYS_EXIT------------------------------------*
  683.  
  684. function sys_exit
  685.     if prompt(7, -1, 'Are you sure that you want to exit BlakBook?', .t., 'Yes', 'No') = 'Y'
  686.         vsetstan(7)
  687.         clear
  688.         vsetcursor(.t.)
  689.         quit
  690.     endif
  691. return ''
  692.  
  693. *----------------------------------TOURGUIDE-----------------------------------*
  694.  
  695. function tourguide
  696.  
  697. private tourfile, printfile, buffer
  698.  
  699. begin sequence
  700.     if prompt(2, -1, 'Welcome to Blakbook, an electronic phone book written to'+;
  701.                       ' take full advantage of ClipI/O features and demonstrate'+;
  702.                       ' them to you.  ClipI/O provides enhanced terminal I/O'+;
  703.                       ' features such as complete mouse support, enhanced video'+;
  704.                       ' support, enhanced keyboard support, and mouse-compatible'+;
  705.                       ' menus and browsers. If after this demo you are interested'+;
  706.                       ' in ClipI/O, feel free to dig around the source code for'+;
  707.                       ' Blakbook.  When you purchase the regular version, you are'+;
  708.                       ' licensed to modify/incorporate/distribute this source code.'+;
  709.                       '  The ClipI/O library is only $49.95.  If you are interested in'+;
  710.                       ' purchasing a copy, please print out the order form: Appendix C'+;
  711.                       ' in the on-line documentation in CLIPIO.MAN.  The library provided'+;
  712.                       ' with this demo works exactly as the regular library, except that'+;
  713.                       ' any programs which make calls to any ClipI/O functions will automatically'+;
  714.                       ' abort after four or five minutes.  Thus, you can use the ClipI/O'+;
  715.                       ' functions in your own programs to see if you are interested in purchasing'+;
  716.                       ' the library.  In order to better demonstrate the features of ClipI/O, a'+;
  717.                       ' "tour-guide" is available.  Would you like to print out the tour-guide?',;
  718.                       .t., 'Yes', 'No') == 'Y'
  719.         tourfile = fopen('tourgide.man', 0)
  720.         if tourfile < 0
  721.             prompt(-1, -1, 'Could not find tourgide.man.  Press any key...', .t.)
  722.             break
  723.         endif
  724.         printfile = fopen('prn', 1)
  725.         if printfile < 0
  726.             prompt(-1, -1, 'Printer not ready/available.  Press any key...', .t.)
  727.             break
  728.         endif
  729.         buffer = space(100)
  730.         do while (fread(tourfile, @buffer, 100) = 100)
  731.             fwrite(printfile, buffer, 100)
  732.         enddo
  733.         fwrite(printfile, buffer, 100)
  734.         fclose(tourfile)
  735.         fclose(printfile)
  736.     endif
  737. end sequence
  738. return ''
  739.  
  740. function freememory
  741.